<?php
class ManageController extends AdminController{

    public function init() {
        $this->tableName='attachment';
        C('storage_path', C('upload_path',null,'uploads'));
        parent::init();
    }
    public function indexAction() {
        $where=$this->_parsemap();
        $this->page=I('request.page','int',1);
        $this->pagesize=C('admin_pagesie',null,20);
        $this->list=$this->model->where($where)->page($this->page)->limit($this->pagesize)->getlist();
        $this->totalnum=$this->model->where($where)->count();
        $this->pagenum=ceil($this->totalnum/$this->pagesize);
        if (IS_AJAX){
            $this->ajax(array('data'=>$this->list,'totalnum'=>$this->totalnum,'pagenum'=>$this->pagenum));
        }else{
            $this->display();
        }

    }
}